package test;

public class SumAvg {
	public static void main(String[] args) {
		int[] arr = { 123, 1, 23, 53, 63 };
		// 累计求和
		int sum = 0;
		// 累计求平均值
		double avg = 0.0;

//		for (int i = 0; i < arr.length; i++) {
//			sum += arr[i];
//		}

		for (int a : arr) {
			sum += a;
		}

		System.out.println(sum);
		avg = sum * 1.0 / arr.length;
		System.out.println(avg);
	}
}
